﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel.Activation;
using System.ServiceModel;
using Microsoft.ServiceModel.Web;

namespace Neptuno.Service.Security
{
    public class NeptunoServiceFactory : ServiceHostFactory
    {
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            WebServiceHost2 result = new WebServiceHost2(serviceType, true, baseAddresses);

            result.Interceptors.Add(new BasicAuthenticationInterceptor());

            return result;
        }
    }
}